PBHSetDirAccessSync
PBHSetDirAccess Set access control information for a shared HFS volume
#include <Files.h> File Manager (PBxxx)
OSErr PBHSetDirAccess(pb, async );
HParmBlkPtr pb ; address of a 48-byte AccessParam structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PBHSetDirAccess lets you change the access rights for a specific folder
including the folder owner's ID and the ID of the folder's primary group.
pb is the address of a 48-byte AccessParam structure. The following
fields are relevant:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
-> ioNamePtr long 4 18 Name of the directory
-> ioVRefNum short 2 22 Volume reference
-> ioACOwnerID long 4 36 New owner identification
-> ioACGroupID long 4 40 Identification of folder's primary group
-> ioACAccess long 4 44 Folder access rights
-> ioDirID long 4 48 Identification number of directory
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nsvErr (-35) No such volume
fnfErr (-43) Not a valid directory
paramErr (-50) Not allowed to set dir owner bit or user-right's bits
accessDenied (-5000) Incorrect access rights to modify directory

Notes: The ioDirID and the ioNamePtr parameters work jointly to pinpoint a
specific directory while ioACOwnerID, ioACGroupID and ioACAccess combine
to give you evidence of the folder's owner, its primary group and how its
access rights are specified, i.e, User's rights, Everyone's right's, Group's
right's or Owner's rights. The AccessParam data structure description
includes a diagram of the format.
Changing the owner or group involves setting the ioACOwnerID or the
ioACGroupID parameters to identify the new owner and group but you must
be the owner of the directory in order to change either of these fields.